y=[760 1600 5000; 600 1000 4800; 580 1000 4800; 580 1000 4800; 700 2000 9000; 780 3000 10000;...
800 4000 9500; 780 3900 9000; 800 3950 7500; 1400 3950 7800; 2000 3600 8000;...
1400 2400 6500];
x=[0;2;4;6;8;10;12;14;16;18;20;22];

red = newff(x,y,3,{'tansig','purelin'});
yred = sim(red,x);
figure; hold on;% varias graficas en un misma ventana
plot(x,y,'+b');
plot(x,yred,'or');
grid on;%grid on pone la grilla de division en el plot
title('Situación Inicial (+=Seno original o=Salida de la red)');


red.trainParam.epochs=1000;

% Entrenamiento y Simulación

red = train(red,x,y);
yred = sim(red,x);% simulacion
figure, hold on;
plot(x,y,'+b'); plot(x,yred,'or'); grid on;
title('Situación Final (+=Seno original o=Salida de la red)');


stem(x,y(1,:)','LineStyle','none','MarkerEdgeColor','b','MarkerFaceColor','auto');
hold on;
stem(x,y(2,:)','LineStyle','none','MarkerEdgeColor','g','MarkerFaceColor','auto');
stem(x,y(3,:)','LineStyle','none','MarkerEdgeColor','r','MarkerFaceColor','auto');

%%%HOLA